package yuan;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @version: 1.0
 * @Description: TODO
 * @author: zZmH
 * @date: 2020/09/20 03:00
 */

@SpringBootApplication
public class Config9001 {

    public static void main(String[] args) {
        SpringApplication.run(Config9001.class, args);
    }
    @Value("${spring.redis.host}")
    String redis;

    @Value("${spring.datasource.url}")
    String ds;

    @Value("${app.user.cache}")
    String app;


    @RestController
    @RequestMapping("/config")
    @RefreshScope
    class ConfigController {

        @Value("${useLocalCache:false}")
        private boolean useLocalCache;


        @RequestMapping("/app")
        public String g3et() {

            return app;
        }

        @RequestMapping("/get")
        public String redis() {
            return redis;

        }

        @RequestMapping("/ds")
        public String ge2t() {



            return ds;
        }







    }
}
